home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1997 February
/
EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso
/
enigma
/
earcd
/
sviluppo
/
svilupp2
/
doorio12.rdm
< prev
next >
Wrap
Text File
|
1997-01-18
|
5KB
|
108 lines
Short: BBS Door In/Out (Multiport)
Author: mac@gorehost.dontpanic.sub.org (Alexander Haarer)
Uploader: cybox@i-online.ohz.north.de (Stephan Schuett)
Type: dev/misc
Update 1.2
Hi there.. this is the Documentation ;) for the door_io.library. 1.2
History:
1.0
- 1st release
1.1
- I have added a routine for reading characters and specify the read length
(BOX_getchrs)
1.2
- Added a Function to read single characters in a BBS.library like manner (BBS.library
belongs to the AmBoS BBS)
(BOX_wgetchr)
- Fixed a bug in the Event-Handling: the Handler was called every time - if the signals
were set or not..
- Improved the Documentation of the Headerfile
I have written it for all BBS-Door programmers (me included).
It should be very useful if one wants to input characters (a string) and react
on events in parallel. This is important for MultiUserDungeons (MUD) and
related things.. I used on in a not_really_MUD named Gore. Its more a
MUDSG .. multiuserdungeonspladdergame..
Well.. it is not very funny if you are typing in a command, and when you are done
with it getting a message "a level 4711 Zombie has shaved you with a chainsaw" :))
An other Thing is the metacharacterexpander (what a word ..)
a "#" is used as a control character. the following character tells what happens:
0 -> color black
1 -> color red
2 -> color green
3 -> color blue
4 -> color yellow
5 -> color magenta
6 -> color cyan
7 -> color white
n -> CR/LF
s -> standard colors
These packetio-routines were originally not a shared lib, but we wanted to use the
thing in a chatter-library (which will be soon available for AmBoS) and so
the door_io.library was born :)
The library and all associated stuff is copyright by A.Haarer 1995+ and it
may be freely used. It may be copied and spread on a non-profit basis.
Commercial use is prohibited without written permission by Author .. ME !! :-)
Hum.. btw this program is thingware.. you may send anything to anyone :)
_______________________________________________________________________________
Q: What is it for ???
A: Its a shared library that simplifies i/o operations in BBS-Cli-Doorprograms
- You are able to wait for Keys AND incoming exec-messages in parallel !
- You are able to specify a "carrier-lost-hook" to do cleanup when the line
breaks down
- it contains a metacharexpander which can generate colored output strings.
________________________________________________________________________________
Q: How does it work ?
A: The library does it's i/o operations by dospackets and therefore can wait()
for an input and other applicationspecific messages. The standard input() and
output() handles are used to determine the handler process.
_________________________________________________________________________________
Q: Why should i use it ? I can also poll the input stream !
A: - Because polling in a multitasking environment ist complete bullshit ;-))
- Polling does slow down the whole system and is bad design, if other solutions
are possible.
- If you are polling single characters, you have to build a string input yourself.
- polling suxx :)
_________________________________________________________________________________
Q: How do i use it ?
A: - Replace your string input function by BOX_getstr()
- Replace your string output function by BOX_getstr() and format the strings
with sprintf() when required.
- Initialize the opened Library with BOX_start() and supply some parameters
- meta_on 1 -> the "#" controls the colors of text output
0 -> the text output is not changed
- carrier_lost_hook (optional) is called when the handler returns an error
(this is standard in most common bbs programs)
- exthandler is called when one of the specified sigbits is set
- sigmask sigmask to trigger the exthandler
- modify the signal mask by BOX_setmask() when required
- Your carrier_lost_hook function should call BOX_stop() and close all resources of
your program
- YOU MUST DECLARE BOTH HOOKFUNCTIONS with __saveds OR EQUIVALENT !
(__saveds restores the near data pointer, for some compilers its __geta4)
- Call BOX_stop() when your program quits
_________________________________________________________________________________
Q: How contact the Author ?
A: - Email to MAC@nasus.ohz.north.de or MAC@gorehost.dontpanic.sub.org
- Call the Castle of Confusion BBS : +49 421 636 7544 or +49 421 636 8643